package com.ag.zlw.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ag.bean.TbLawnature;
import com.ag.common.AgException;
import com.ag.common.IDUtil;
import com.ag.common.IIDService;
import com.ag.zlw.dao.TbLawnatureDAO;
import com.ag.zlw.service.LawnatureService;

/**
 * 法规性质
 * 
 * @author 钟龙伟
 * 
 */

@Service("LawnatureService")
public class LawnatureServiceImpl implements LawnatureService {
	@Resource(name = "ZLWTbLawnatureDAO")
	private TbLawnatureDAO tbLawnatureDAO;

	private String IDs;
	@Resource(name = "iDServiceImpl")
	private IIDService idservice;

	public void save(TbLawnature Lawnature) throws AgException {
		IDs = (String) idservice.findTablePK(IDUtil.TB_LAWNATURE);
		Lawnature.setLnId(IDs);
		tbLawnatureDAO.save(Lawnature);
	}

	public List<TbLawnature> findAll() {
		return tbLawnatureDAO.findAll();
	}

	public void delete(TbLawnature Lawnature) {
		TbLawnature tbLawnature = tbLawnatureDAO.findById(Lawnature.getLnId());
		tbLawnature.setA(IDUtil.DELETE);
		tbLawnatureDAO.attachDirty(tbLawnature);
	}

	public void modify(TbLawnature Lawnature) {
		tbLawnatureDAO.attachDirty(Lawnature);
	}
}
